const mongoose = require('mongoose')
const Schema = mongoose.Schema
require('./Category')

const schema = new Schema({
  title: { type: String },
  categories: [{
    type: Schema.Types.ObjectId,
    ref: 'Category' //关联
  }],
  content: {type: String}
})

module.exports = mongoose.model('Article', schema)
